package bittwiddling;

public class Tricks {

	// find whether a num is power of 2
	public static boolean isPowerOfTwo(int num){
		if(num == 0) return false;
		return (num & (num - 1)) == 0 ? true: false; 
	}
	
	// find whether a num is even
	public static boolean isEven(int num){
		return (num & 1) == 0 ? true: false; 
	}
	
	// TBD: circular shift
	
	// TBD: finding modulus by a number which is power of 2
	
	// TBD: program to convert decimal into binary 
	
}
